﻿

@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using Microsoft.AspNetCore.Localization
@using Microsoft.AspNetCore.Mvc.Localization
@inject IViewLocalizer Localizer
@inject IHtmlLocalizer<SharedResources> SharedLocalizer


<div id="appModel">
    <div style="width:18%;float:left; height:90%;overflow:auto;">
        <div style="height:10px;"></div>
        @*组织树*@
        <ul id="orgTree" class="ztree"></ul>

    </div>
    <div style="width:2%;float:left;"></div>
    <div style="width:80%;float:right;">

        <div class="panel panel-default">
            @*<div class="panel-heading">查询条件</div>*@
            <div class="panel-body">
                <div class="input-group">
                    <input id="txt_keyword" type="text" class="form-control" placeholder="@SharedLocalizer["KeyPlaceHolder"]" style="width: 260px;" v-model="queryKey">
                    
                    <span class="input-group-btn">
                        <button id="btn_search" type="button" class="btn  btn-primary-blue" v-on:click="search"><i class="fa fa-search"></i>查询</button>
                    </span>


                </div>
            </div>

        </div>
        <div id="toolbar">
            <div class="btn-group">
                @*<a class="btn btn-default" onclick="$dh.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
                <button class="btn btn-default" v-bind:disabled="!selectedData" v-on:click="edit"><i class="fa fa-pencil-square-o"></i>@SharedLocalizer["Update"]</button>
                <button class="btn btn-default" v-bind:disabled="!selectedData" v-on:click="del"><i class="fa fa-trash-o"></i>@SharedLocalizer["Delete"]</button>
                <button class="btn btn-default" v-on:click="add"><i class="fa fa-plus"></i>@SharedLocalizer["Add"]</button>*@
                @await Html.PartialAsync("_Partical_Button")
            </div>

        </div>
        <div class="table-responsive" style="width:100%">
            <table class="table table-no-bordered " id="tb_orgs"></table>
        </div>
        
        <modal-dialog v-show="showDialog" :title="modalTitle" :entity="entityObj" :btnclose="btnClose" :btnsubmit="btnSubmit">
            <div slot="modal-body">

                <form id="form1">
                    <div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
                        <div style=" margin-right: 30px;">
                            <table class="form">
                                <tr>
                                    <td class="formTitle">上级</td>
                                    <td class="formValue">

                                        <input type="text" id="ParentName" name="ParentName" v-model="entityObj.ParentName" style="width:159px;height:30px;" class="form-control required" />
                                        <input type="hidden" id="ParentId" name="ParentId" v-model="entityObj.ParentId" />
                                        <div id="menuContent" class="menuContent" style="display: none;">
                                            <ul id="parentOrgTree" class="ztree"></ul>
                                        </div>
                                    </td>
                                    <td class="formTitle">类型</td>
                                    <td class="formValue">
                                        <select id="CategoryId" name="CategoryId" class="form-control required" v-model="entityObj.CategoryId">
                                            <option value="">==请选择==</option>
                                            <option value="Group">集团</option>
                                            <option value="Company">公司</option>
                                            <option value="Department">部门</option>
                                            <option value="WorkGroup">小组</option>
                                        </select>


                                    </td>
                                </tr>
                                <tr>

                                    <td class="formTitle">名称</td>
                                    <td class="formValue">
                                        <input id="Name" name="Name" type="text" class="form-control required" placeholder="请输入名称" v-model="entityObj.FullName" />
                                    </td>
                                    <td class="formTitle">编号</td>
                                    <td class="formValue">
                                        <input id="EnCode" name="EnCode" type="text" class="form-control required" placeholder="请输入编号" v-model="entityObj.EnCode" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">序号</td>
                                    <td class="formValue" colspan="3">
                                        <input type="number" id="SortIndex" name="SortIndex" class="form-control required" v-model="entityObj.SortIndex" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">负责人</td>
                                    <td class="formValue">
                                        <input id="Manager" name="Manager" type="text" class="form-control" v-model="entityObj.ManagerId" />
                                    </td>
                                    <td class="formTitle">手机</td>
                                    <td class="formValue">
                                        <input id="MobilePhone" name="MobilePhone" type="text" class="form-control" v-model="entityObj.MobilePhone" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">微信</td>
                                    <td class="formValue">
                                        <input id="WeChat" name="WeChat" type="text" class="form-control " v-model="entityObj.WeChat" />

                                    </td>
                                    <td class="formTitle">电话</td>
                                    <td class="formValue">
                                        <input id="Telephone" name="Telephone" type="text" class="form-control" v-model="entityObj.TelePhone" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">邮箱</td>
                                    <td class="formValue">
                                        <input id="Email" name="Email" type="text" class="form-control" v-model="entityObj.Email" />
                                    </td>
                                    <td class="formTitle">传真</td>
                                    <td class="formValue">
                                        <input id="Fax" name="Fax" type="text" class="form-control" v-model="entityObj.Fax" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">地址</td>
                                    <td class="formValue" colspan="3">
                                        <input id="txtAddress" name="txtAddress" class="form-control" v-model="entityObj.Address" />
                                    </td>
                                </tr>
                                <tr>
                                    <th class="formTitle">选项</th>
                                    <td class="formValue" colspan="3" style="padding-top:1px;">
                                        <div class="ckbox">
                                            <input id="F_EnabledMark" name="F_EnabledMark" type="checkbox" v-model="entityObj.EnabledMark"><label for="F_EnabledMark">是否有效</label>
                                        </div>

                                    </td>
                                </tr>

                                <tr>
                                    <td class="formTitle" valign="top" style="padding-top: 5px;">
                                        备注
                                    </td>
                                    <td class="formValue" colspan="3">
                                        <textarea id="Description" name="Description" class="form-control" style="height: 60px;" v-model="entityObj.Description"></textarea>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </form>
            </div>

        </modal-dialog>
    </div>
</div>





<script src="~/content/js/base.js"></script>
<script type="text/javascript">
    var _getModelsUrl = "@this.Href("~/Organize/GetOrgs")";
    var _addModelUrl = "@this.Href("~/Organize/Add")";
    var _updateModelUrl = "@this.Href("~/Organize/Update")";
    var _deleteModelUrl = "@this.Href("~/Organize/Delete")";
    var _getSelectTreeDataUrl = "@this.Href("~/Organize/SelectTreeData")";
    var _getTreeDataUrl = "@this.Href("~/Organize/TreeData")";
    var _getComboTreeDataUrl = "@this.Href("~/Organize/ComboTreeData")";
    var _checkExistSortUrl = "@this.Href("~/Organize/CheckSortId")";
    var _parentOrgTree;
    var _deleteRemand = "@Localizer["DeleteConfirm"]";
    var _enabledStr = "@SharedLocalizer["Enabled"]";
    var _disabledStr = "@SharedLocalizer["Disabled"]";


</script>
<script src="~/js/Views/Org/Index.js"></script>